#include <iostream>

using namespace std;


class Fibonacci
{
	int a0;
	int a1;
public:
	Fibonacci()
	{
		a0 = 0;
		a1 = 1;
	}
	
	Fibonacci(int n)
	{
		a0 = 0;
		a1 = 1;

		for (int i = 2; i <= n; i++)
		{
			int ret = a1;
			a1 = a0 + a1;
			a0 = ret;
		}
	}

	int operator () ()
	{
		int ret = a1;
		a1 = a0 + a1;
		a0 = ret;
		return ret;
	}

};

int main(int argc, char **argv)
{
	Fibonacci fib;

	for (int i = 0; i < 15; i++)
	{
		cout << fib() << endl;
	}

	cout << "-----------------------" << endl;
	Fibonacci fib2(10);

	for (int i = 10; i < 15; i++)
	{
		cout << fib2() << endl;
	}
	
	return 0;
}